<template>
  <div class="u-p-20">
    <el-card shadow="never">
      <div slot="header">
        <span>
          <b class="u-f-16">用户收益列表</b>
        </span>
        <!-- <div class="u-right u-5mt">
                    <el-button size="small" icon="el-icon-back" @click="$router.go(-1)">返回</el-button>
        </div>-->
      </div>

      <el-table :data="tableData" class="u-mt-10" v-viewer>
        <el-table-column label="id" prop="id" width="100"></el-table-column>
        <el-table-column label="收益类型">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.type==1" type="info">返现</el-tag>
            <el-tag v-if="scope.row.type==2" type="warning">佣金</el-tag>
            <el-tag v-if="scope.row.type==3" type="danger">任务</el-tag>
            <el-tag v-if="scope.row.type==4" type="danger">提现</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="金额" prop="price"></el-table-column>
        <el-table-column label="状态">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.change=='add'" type="info">增加</el-tag>
            <el-tag v-if="scope.row.change=='sub'" type="warning">减少</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="是否审核">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.check==0" type="success">审核通过</el-tag>
            <el-tag v-if="scope.row.check==1" type="warning">待审核</el-tag>
            <el-tag v-if="scope.row.check==2" type="danger">审核失败</el-tag>
          </template>
        </el-table-column>
        <el-table-column label="说明" prop="detail"></el-table-column>
        <el-table-column label="审核时间" prop="check_time"></el-table-column>
      </el-table>

      <div class="u-mt-20 u-text-center">
        <el-pagination
          background
          @size-change="handleSizeChange"
          @current-change="handlePageChange"
          :current-page="currentPage"
          :page-sizes="[10, 20, 30, 40, 50]"
          :page-size="limit"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        ></el-pagination>
      </div>
    </el-card>
  </div>
</template>

<script>
import commonPage from "@/mixins/common-page";
export default {
  mixins: [commonPage],
  props: {
    userId: {
      type: String
    }
  },
  data() {
    return {
      apiName: "user",
      apiPage: "earningsPage", //方法
      queryForm: {
        user_id: this.userId
      }
    };
  },
  methods: {}
};
</script>
